
%%% Weighting the Evidence: A Rank-Dependent Model of Outdoor Recreation, June 2024
%%% This file generates Figures 2 and A-2

%FIGURE 2 IN THE PAPER:
figure;
fplot(@(x) exp(-(-log(x))^0.464),[0,0.9999],'Linewidth',2.5,'Color',[.6 .6 .6]);
hold on
fplot(@(x) x^0.594/(((x^0.5942+(1-x)^0.5942))^(1/0.5942)),[0,0.99999999],'Linewidth',2.5,'Color',"black");
fplot(@(x) x,[0,0.99999999],'Linewidth',1.5,'LineStyle',"--",'Color', "black");
%title('Estimated Probability Weighting Functions','FontSize',36)
legend('Prelec','Tversky & Kahneman','Location','best','FontSize',28,'Interpreter','latex')
xlabel(' $p$', 'FontSize',24,'Interpreter','latex')
ylabel('$w(p)$','FontSize',24,'Interpreter','latex')
set(gca,'FontSize',18)
hold off
saveas(gcf,'Figure2','epsc')

%FIGURE A-2 IN THE PAPER:
%Top Papnel
figure;
fplot(@(x) x^0.594/(((x^0.5942+(1-x)^0.5942))^(1/0.5942)),[0,0.99999999],'Linewidth',2.5,'Color',"black");
hold on
fplot(@(x) x^0.82/(((x^0.82+(1-x)^0.82))^(1/0.82)),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) x^0.7/(((x^0.7+(1-x)^0.7))^(1/0.7)),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) x^0.55/(((x^0.55+(1-x)^0.55))^(1/0.55)),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) x^0.5/(((x^0.5+(1-x)^0.5))^(1/0.5)),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) x^0.45/(((x^0.45+(1-x)^0.45))^(1/0.45)),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) x^0.4/(((x^0.4+(1-x)^0.4))^(1/0.4)),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) x^0.36/(((x^0.36+(1-x)^0.36))^(1/0.36)),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
title('Tversky \& Kahneman $w(p)$','FontSize',36,'Interpreter','latex');
xlabel(' $p$', 'FontSize',24,'Interpreter','latex')
ylabel('$w(p)$','FontSize',24,'Interpreter','latex')
set(gca,'FontSize',18)
hold off
saveas(gcf,'FigureA2_a','epsc')

%Bottom Papnel
figure;
fplot(@(x) exp(-(-log(x))^0.464),[0,0.99999999],'Linewidth',2.5,'Color',"black");
hold on
fplot(@(x) exp(-(-log(x))^0.8),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) exp(-(-log(x))^0.7),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) exp(-(-log(x))^0.6),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) exp(-(-log(x))^0.4),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) exp(-(-log(x))^0.3),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) exp(-(-log(x))^0.2),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
fplot(@(x) exp(-(-log(x))^0.1),[0,0.99999999],'Linewidth',0.5,'LineStyle',"--",'Color',"black");
title('Prelec $w(p)$','FontSize',36,'Interpreter','latex');
xlabel(' $p$', 'FontSize',24,'Interpreter','latex')
ylabel('$w(p)$','FontSize',24,'Interpreter','latex')
set(gca,'FontSize',18)
hold off
saveas(gcf,'FigureA2_a','epsc')




